Optimal. Leaf size=91 \[ \frac {a \left (2 a^2-3 b^2\right ) \tanh ^{-1}(\sin (c+d x))}{2 d}+\frac {b \sec (c+d x) (a+b \tan (c+d x))^2}{3 d}+\frac {b \sec (c+d x) \left (4 \left (4 a^2-b^2\right )+5 a b \tan (c+d x)\right )}{6 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.07, antiderivative size = 109, normalized size of antiderivative = 1.20, number of steps
used = 4, number of rules used = 4, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.210, Rules used = {3593, 757, 794,
221} \begin {gather*} \frac {b \sec (c+d x) \left (4 \left (4 a^2-b^2\right )+5 a b \tan (c+d x)\right )}{6 d}+\frac {a \left (2 a^2-3 b^2\right ) \sec (c+d x) \sinh ^{-1}(\tan (c+d x))}{2 d \sqrt {\sec ^2(c+d x)}}+\frac {b \sec (c+d x) (a+b \tan (c+d x))^2}{3 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 221
Rule 757
Rule 794
Rule 3593
Rubi steps
\begin {align*} \int \sec (c+d x) (a+b \tan (c+d x))^3 \, dx &=\frac {\sec (c+d x) \text {Subst}\left (\int \frac {(a+x)^3}{\sqrt {1+\frac {x^2}{b^2}}} \, dx,x,b \tan (c+d x)\right )}{b d \sqrt {\sec ^2(c+d x)}}\\ &=\frac {b \sec (c+d x) (a+b \tan (c+d x))^2}{3 d}+\frac {(b \sec (c+d x)) \text {Subst}\left (\int \frac {(a+x) \left (-2+\frac {3 a^2}{b^2}+\frac {5 a x}{b^2}\right )}{\sqrt {1+\frac {x^2}{b^2}}} \, dx,x,b \tan (c+d x)\right )}{3 d \sqrt {\sec ^2(c+d x)}}\\ &=\frac {b \sec (c+d x) (a+b \tan (c+d x))^2}{3 d}+\frac {b \sec (c+d x) \left (4 \left (4 a^2-b^2\right )+5 a b \tan (c+d x)\right )}{6 d}-\frac {\left (a \left (3-\frac {2 a^2}{b^2}\right ) b \sec (c+d x)\right ) \text {Subst}\left (\int \frac {1}{\sqrt {1+\frac {x^2}{b^2}}} \, dx,x,b \tan (c+d x)\right )}{2 d \sqrt {\sec ^2(c+d x)}}\\ &=\frac {a \left (2 a^2-3 b^2\right ) \sinh ^{-1}(\tan (c+d x)) \sec (c+d x)}{2 d \sqrt {\sec ^2(c+d x)}}+\frac {b \sec (c+d x) (a+b \tan (c+d x))^2}{3 d}+\frac {b \sec (c+d x) \left (4 \left (4 a^2-b^2\right )+5 a b \tan (c+d x)\right )}{6 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(293\) vs. \(2(91)=182\).
time = 1.68, size = 293, normalized size = 3.22 \begin {gather*} \frac {36 a^2 b-10 b^3-6 a \left (2 a^2-3 b^2\right ) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )+12 a^3 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )-18 a b^2 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )+\frac {9 a b^2}{\left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )^2}+\frac {b^3}{\left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )^2}+2 b \left (18 a^2-b^2+2 b^2 \cos (c+d x)+\left (18 a^2-5 b^2\right ) \cos (2 (c+d x))\right ) \sec ^3(c+d x) \sin ^2\left (\frac {1}{2} (c+d x)\right )-\frac {9 a b^2}{\left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )^2}+\frac {b^3}{\left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )^2}}{12 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.12, size = 146, normalized size = 1.60
method | result | size |
derivativedivides | \(\frac {b^{3} \left (\frac {\sin ^{4}\left (d x +c \right )}{3 \cos \left (d x +c \right )^{3}}-\frac {\sin ^{4}\left (d x +c \right )}{3 \cos \left (d x +c \right )}-\frac {\left (2+\sin ^{2}\left (d x +c \right )\right ) \cos \left (d x +c \right )}{3}\right )+3 b^{2} a \left (\frac {\sin ^{3}\left (d x +c \right )}{2 \cos \left (d x +c \right )^{2}}+\frac {\sin \left (d x +c \right )}{2}-\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+\frac {3 a^{2} b}{\cos \left (d x +c \right )}+a^{3} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{d}\) | \(146\) |
default | \(\frac {b^{3} \left (\frac {\sin ^{4}\left (d x +c \right )}{3 \cos \left (d x +c \right )^{3}}-\frac {\sin ^{4}\left (d x +c \right )}{3 \cos \left (d x +c \right )}-\frac {\left (2+\sin ^{2}\left (d x +c \right )\right ) \cos \left (d x +c \right )}{3}\right )+3 b^{2} a \left (\frac {\sin ^{3}\left (d x +c \right )}{2 \cos \left (d x +c \right )^{2}}+\frac {\sin \left (d x +c \right )}{2}-\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+\frac {3 a^{2} b}{\cos \left (d x +c \right )}+a^{3} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{d}\) | \(146\) |
risch | \(-\frac {b \left (9 i a b \,{\mathrm e}^{5 i \left (d x +c \right )}-18 a^{2} {\mathrm e}^{5 i \left (d x +c \right )}+6 b^{2} {\mathrm e}^{5 i \left (d x +c \right )}-36 a^{2} {\mathrm e}^{3 i \left (d x +c \right )}+4 b^{2} {\mathrm e}^{3 i \left (d x +c \right )}-9 i a b \,{\mathrm e}^{i \left (d x +c \right )}-18 a^{2} {\mathrm e}^{i \left (d x +c \right )}+6 b^{2} {\mathrm e}^{i \left (d x +c \right )}\right )}{3 d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{3}}+\frac {a^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{d}-\frac {3 a \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) b^{2}}{2 d}-\frac {a^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{d}+\frac {3 a \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) b^{2}}{2 d}\) | \(219\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.28, size = 111, normalized size = 1.22 \begin {gather*} -\frac {9 \, a b^{2} {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} + \log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - 12 \, a^{3} \log \left (\sec \left (d x + c\right ) + \tan \left (d x + c\right )\right ) - \frac {36 \, a^{2} b}{\cos \left (d x + c\right )} + \frac {4 \, {\left (3 \, \cos \left (d x + c\right )^{2} - 1\right )} b^{3}}{\cos \left (d x + c\right )^{3}}}{12 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.39, size = 123, normalized size = 1.35 \begin {gather*} \frac {3 \, {\left (2 \, a^{3} - 3 \, a b^{2}\right )} \cos \left (d x + c\right )^{3} \log \left (\sin \left (d x + c\right ) + 1\right ) - 3 \, {\left (2 \, a^{3} - 3 \, a b^{2}\right )} \cos \left (d x + c\right )^{3} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 18 \, a b^{2} \cos \left (d x + c\right ) \sin \left (d x + c\right ) + 4 \, b^{3} + 12 \, {\left (3 \, a^{2} b - b^{3}\right )} \cos \left (d x + c\right )^{2}}{12 \, d \cos \left (d x + c\right )^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (a + b \tan {\left (c + d x \right )}\right )^{3} \sec {\left (c + d x \right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 171 vs.
\(2 (82) = 164\).
time = 0.90, size = 171, normalized size = 1.88 \begin {gather*} \frac {3 \, {\left (2 \, a^{3} - 3 \, a b^{2}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - 3 \, {\left (2 \, a^{3} - 3 \, a b^{2}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) + \frac {2 \, {\left (9 \, a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 18 \, a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} + 36 \, a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 12 \, b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 9 \, a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 18 \, a^{2} b + 4 \, b^{3}\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{3}}}{6 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 5.53, size = 160, normalized size = 1.76 \begin {gather*} -\frac {\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )\,\left (3\,a\,b^2-2\,a^3\right )}{d}-\frac {6\,a^2\,b-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (12\,a^2\,b-4\,b^3\right )-\frac {4\,b^3}{3}+3\,a\,b^2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+6\,a^2\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4-3\,a\,b^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6-3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2-1\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________